<?php

namespace cash\Controller;
use Think\Controller;
use Think\Hook;
use Think\Think;
class ApibaseController extends Controller
{
    /*
	 * 基类初始化
	 */
	public function __construct(){
        Hook::listen('action_begin',$this->config);
        //实例化视图类
        $this->view     = Think::instance('Think\View');
        //控制器初始化
        if(method_exists($this,'_initialize'))
			$this->_initialize();
	    //登陆状态验证
        if(!is_login() && !in_array(get_class($this),C('FiterControl'))){
            redirect('/user/login');
        }
        $this->auth();
	}

	private function auth() {
        $menus = C('menus');
        $this->assign('menus', $menus);
    }
}